<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var time = prompt('请输入时间：');
        if (parseInt(time) >= 0 && parseInt(time) < 6) {
            alert('凌晨好')
        } else if (parseInt(time) == 6) {
            alert('早上好')
        } else if (parseInt(time) > 6 && parseInt(time) < 12) {
            alert('上午好')
        } else if (parseInt(time) == 12) {
            alert('中午好')
        } else if (parseInt(time) > 12 && parseInt(time) < 18) {
            alert('下午好')
        } else if (parseInt(time) == 18) {
            alert('傍晚好')
        } else if (parseInt(time) > 18 && parseInt(time) <= 23) {
            alert('晚上好')
        } else {
            alert('输入有误')
        }
    </script>
</head>

<body>

</body>

</html>